from sqlalchemy import Column, Integer, String, Float,Boolean
from database import Base

class Student(Base):
    __tablename__ = "students"
    id     = Column(Integer, primary_key=True, index=True)
    name   = Column(String(50), nullable=False)
    gender = Column(String(2), nullable=False)
    height = Column(Integer, nullable=False)
    weight = Column(Float, nullable=False)
    hobby  = Column(String(20), nullable=False)

# 追加
class Option(Base):
    __tablename__ = "option"
    id      = Column(Integer, primary_key=True, autoincrement=True)
    opkey   = Column(String(50), unique=True, nullable=False, index=True)
    opvalue = Column(String(255), default="0", nullable=False)   # 改成字符串

class CheckIsRight(Base):
    __tablename__ = "checkIsRight"
    id      = Column(Integer, primary_key=True, autoincrement=True)
    stuid   = Column(Integer, nullable=False, index=True)
    isright = Column(Boolean, nullable=False, default=False)   # bit → Bool